import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class TestDay26 {
    //青蛙跳台
    public int jumpFloorII (int number) {
        // write code here
        return (int)Math.pow(2,number-1);
    }

    //小猫咪钻罐子
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            //猫
            String s1 = scanner.next();
            //罐子
            String s2 = scanner.next();
            LinkedList<Integer> list1 = new LinkedList<>();
            LinkedList<Integer> list2 = new LinkedList<>();
            for (int i = 0; i < s1.length(); i++) {
                list1.add(s1.charAt(i)-'0');
            }
            for (int i = 0; i < s2.length(); i++) {
                list2.add(s2.charAt(i)-'0');
            }
            int size = list2.size()-1;//对应最后一个元素得下标
//            for (int i = size; i >= 0; i--) {
//                //将size下标得值*2
//                list2.set(i,list2.get(i)*2);
//
//            }
//            //再全部进数
//            for (int i = size; i >= 0 ; i--) {
//                if(list2.get(i) >= 10){
//                    //进位,将前面得值+1
//                    if(i == 0){
//                        //如果是头插就插入1
//                        list2.addFirst(1);
//                        list2.set( 1 ,list2.get(1) % 10);
//                    }else {
//                        //如果不是头插就修改值
//                        list2.set( i-1 ,list2.get(i-1)+1);
//                        //进位后将当前值%10
//                        list2.set( i ,list2.get(i) % 10);
//
//                    }
//                }
//            }
//            System.out.println(list2);
            size = list2.size()-1;//重新更新下size的值
            //Πd,此时d处理了,就差*Π了
            //*314
            LinkedList<Integer> list = new LinkedList<>();
            int[]pai = {6,2,8};
            int n1 = 0;//记录相加
            int n2 = 0;//记录相乘
            int z = 0;//一直记录倒数第二个位置
            for (int i = 2; i >= 0 ; i--) {
                n1++;
                n2 = n1;
                for (int j = size; j >= 0 ; j--) {
                    z = list.size()-n2;
                    int p = list2.get(j);
                    //说明此时没有对应的值
                    if(z == -1){
                        list.addFirst(p * pai[i]);
                        z++;
                    }else {
                        int tmp = list.get(z);
                        list.set(z,p * pai[i]+tmp);
                    }
                    if(list.get(z) >= 10){
                        //如果为0,说明需要头插
                        if(z == 0){
                            list.addFirst(list.get(z)/10);
                            z++;
                        }else {
                            //如果不为0,就给前面的值加上进的位数
                            int tmp = list.get(z-1);
                            list.set(z-1,list.get(z) / 10+tmp);
                        }
                        list.set(z,list.get(z) % 10);
                    }
                    n2++;

                }
            }
            System.out.println(list);
            //做个标记,记录这个数组从哪里开始是小数
            int len = list.size()-2;
            //从后往前数,去二位0
            int i = 0;
            while (i < 2){
                //获取后数两位
                //如果是0就删除
                if(list.get(list.size()-1) == 0){
                    list.pollLast();

                }
                i++;
            }
            size = 0;//记录次数
            //类似于 12   111
            if(list1.size() > len){
                System.out.println("No");
            }else if(list1.size() < len){
                System.out.println("Yes");
            }else {
                //两个一样长时

                while (list1.size() != 0 && list.size() !=0){
                    //如果猫的身长小于碗的周长
                    if(list1.peekFirst() < list.peekFirst()){
                        System.out.println("Yes");
                        break;
                    }else if(list1.peekFirst() > list.peekFirst()){
                        System.out.println("No");
                        break;
                    }else {
                        list1.pollFirst();
                        list.pollFirst();
                    }
                    size++;
                }
                if(list1.size() == 0 && (list.get(0)!=0 || list.get(1)!=0))
                    System.out.println("Yes");
            }
        }

    }
}
